using System;
using System.Data;
using System.Runtime.Serialization;
namespace Common
{
    /// <summary>
    /// RegistroAuditoriaData datatable.
    /// </summary>

    [Serializable()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public class RegistroAuditoriaData : DataTable
    {
        #region constructor
        protected RegistroAuditoriaData(SerializationInfo info, StreamingContext context)
        {
        }

        public RegistroAuditoriaData()
        {
            BuildDataTables();
        }
        #endregion

        #region  Constants for table and fields mapping

        public const String ADM_REGISTRO_AUDITORIA_TABLE = "ADM_REGISTRO_AUDITORIA";

        public const String REG_ID_FIELD = "REG_ID";
        public const String REG_ORIGEN_FIELD = "REG_ORIGEN";
        public const String OPC_ID_FIELD = "OPC_ID";
        public const String OPC_DESCRIPCION_FIELD = "OPC_DESCRIPCION";
        public const String ACC_ID_FIELD = "ACC_ID";
        public const String ACC_NOMBRE_FIELD = "ACC_NOMBRE";
        public const String PER_ID_FIELD = "PER_ID";
        public const String PER_NOMBRE_FIELD = "PER_NOMBRE";
        public const String USU_ID_FIELD = "USU_ID";
        public const String USU_NOMBRE_FIELD = "USU_NOMBRE";
        public const String USU_TIPO_FIELD = "USU_TIPO";
        public const String REG_FECHA_FIELD = "REG_FECHA";
        public const String REG_IDENTIFICADOR_FIELD = "REG_IDENTIFICADOR";
        public const String REG_DESCRIPCION_FIELD = "REG_DESCRIPCION";
        public const String REG_REGISTRO_ANTES_FIELD = "REG_REGISTRO_ANTES";
        public const String REG_REGISTRO_ACTUAL_FIELD = "REG_REGISTRO_ACTUAL";
        public const String REG_IP_FIELD = "REG_IP";
        public const String REG_MENSAJE_FIELD = "REG_MENSAJE";


        #endregion

        /// <summary>
        /// Creates the following datatables: ADM_REGISTRO_AUDITORIA
        /// </summary>
        private void BuildDataTables()
        {
            this.Columns.Add(REG_ID_FIELD, typeof(System.Decimal));
            this.Columns.Add(REG_ORIGEN_FIELD, typeof(System.Decimal));
            this.Columns.Add(OPC_ID_FIELD, typeof(System.Decimal));
            this.Columns.Add(OPC_DESCRIPCION_FIELD, typeof(System.String));
            this.Columns.Add(ACC_ID_FIELD, typeof(System.Decimal));
            this.Columns.Add(ACC_NOMBRE_FIELD, typeof(System.String));
            this.Columns.Add(USU_ID_FIELD, typeof(System.Decimal));
            this.Columns.Add(USU_NOMBRE_FIELD, typeof(System.String));
            this.Columns.Add(USU_TIPO_FIELD, typeof(System.String));

            this.Columns.Add(REG_FECHA_FIELD, typeof(System.DateTime));
            this.Columns.Add(REG_IDENTIFICADOR_FIELD, typeof(System.Decimal));
            this.Columns.Add(REG_DESCRIPCION_FIELD, typeof(System.String));
            this.Columns.Add(REG_REGISTRO_ANTES_FIELD, typeof(System.String));
            this.Columns.Add(REG_REGISTRO_ACTUAL_FIELD, typeof(System.String));
            this.Columns.Add(REG_IP_FIELD, typeof(System.String));
            this.Columns.Add(PER_ID_FIELD, typeof(System.Decimal));
            this.Columns.Add(PER_NOMBRE_FIELD, typeof(System.String));
            this.Columns.Add(REG_MENSAJE_FIELD, typeof(System.String));

            this.PrimaryKey = new DataColumn[] { this.Columns[REG_ID_FIELD] };
        }

        /// <summary>
        /// Add a new row to the table
        /// </summary>
        /// <param name="row">Dataset row</param>
        public void addRow(DataRow row)
        {
            this.Rows.Add(row);
        }

    }
}
